package com.farm.agricultural.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.farm.agricultural.mapper.AgriculturalMapper;
import com.farm.agricultural.domain.Agricultural;
import com.farm.agricultural.service.IAgriculturalService;

/**
 * 农资管理Service业务层处理
 * 
 * @author yd
 * @date 2024-03-07
 */
@Service
public class AgriculturalServiceImpl implements IAgriculturalService 
{
    @Autowired
    private AgriculturalMapper agriculturalMapper;

    /**
     * 查询农资管理
     * 
     * @param agriculturalId 农资管理主键
     * @return 农资管理
     */
    @Override
    public Agricultural selectAgriculturalByAgriculturalId(Long agriculturalId)
    {
        return agriculturalMapper.selectAgriculturalByAgriculturalId(agriculturalId);
    }

    /**
     * 查询农资管理列表
     * 
     * @param agricultural 农资管理
     * @return 农资管理
     */
    @Override
    public List<Agricultural> selectAgriculturalList(Agricultural agricultural)
    {
        return agriculturalMapper.selectAgriculturalList(agricultural);
    }

    /**
     * 新增农资管理
     * 
     * @param agricultural 农资管理
     * @return 结果
     */
    @Override
    public int insertAgricultural(Agricultural agricultural)
    {
        return agriculturalMapper.insertAgricultural(agricultural);
    }

    /**
     * 修改农资管理
     * 
     * @param agricultural 农资管理
     * @return 结果
     */
    @Override
    public int updateAgricultural(Agricultural agricultural)
    {
        return agriculturalMapper.updateAgricultural(agricultural);
    }

    /**
     * 批量删除农资管理
     * 
     * @param agriculturalIds 需要删除的农资管理主键
     * @return 结果
     */
    @Override
    public int deleteAgriculturalByAgriculturalIds(Long[] agriculturalIds)
    {
        return agriculturalMapper.deleteAgriculturalByAgriculturalIds(agriculturalIds);
    }

    /**
     * 删除农资管理信息
     * 
     * @param agriculturalId 农资管理主键
     * @return 结果
     */
    @Override
    public int deleteAgriculturalByAgriculturalId(Long agriculturalId)
    {
        return agriculturalMapper.deleteAgriculturalByAgriculturalId(agriculturalId);
    }
}
